package com.example.italkapp2.utils;

/**
 * @author MiloYe
 * @version 1.0
 * @description
 * @date 2021/6/7 10:10
 */
public class myParse {
    static private myParse instance;
    private myParse() {

    }

    static public myParse getInstance() {
        if (instance == null) {
            instance = new myParse();
        }
        return instance;
    }

    public Long paraseIntInRange(String str, int n) {
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < str.length(); i++) {
            System.out.println((int)str.charAt(i));
            stringBuilder.append(String.valueOf((int)str.charAt(i)));
        }
        return stringBuilder.toString().length() != 0 ?  Long.parseLong(stringBuilder.toString()) % n : 0;
    }
}
